package classification.geneticAlgorithm;

public class Individual
{
    public double value     = 0.0;
    public int    DNALength = 0;
    public int[]  DNA       = null;

    public Individual()
    {
        
    }

    public Individual(int initDNALength)
    {
        this.value = 0.0;
        this.DNALength = initDNALength;
        this.DNA = new int[DNALength];
    }

    public Individual(Individual indv)
    {
        this.value = indv.value;
        this.DNALength = indv.DNALength;
        this.DNA = new int[this.DNALength];
        for (int digit = 0; digit < indv.DNALength; digit++)
        {
            this.DNA[digit] = indv.DNA[digit];
        }
    }

    public void setValue(double newValue)
    {
        this.value = newValue;
    }

    public void setDNA(int[] newDNA)
    {
        this.DNA = newDNA;
    }
}
